//
//  AuctionTimeModel.m
//  PPDL
//
//  Created by 王洋 on 2019/9/11.
//  Copyright © 2019 王洋. All rights reserved.
//

#import "AuctionTimeModel.h"

@implementation AuctionTimeModel

+ (AuctionTimeModel *)getTodayAfterDateWithCount:(NSInteger)count {
    
    NSDate *currentDate = [NSDate date];
    
    AuctionTimeModel *model = [[AuctionTimeModel alloc] init];
    
    NSDate *appointDate;    // 指定日期声明
    NSTimeInterval oneDay = 24 * 60 * 60;  // 一天一共有多少秒
    appointDate = [currentDate initWithTimeIntervalSinceNow: oneDay * count];
    
    NSTimeInterval timeSp = (double)([appointDate timeIntervalSince1970]*1000);

    model.dayTimeStr = timeSp;
    
    NSDateFormatter * dayStringformatter=[[NSDateFormatter alloc] init];
    [dayStringformatter setDateFormat:@"YYYY-MM-dd"];
    NSString *dayString=[dayStringformatter stringFromDate:appointDate];
    model.dayString = dayString;
    
    NSDateFormatter * dateStringformatter=[[NSDateFormatter alloc] init];
    [dateStringformatter setDateFormat:@"MM月dd日"];
    NSString *dateString=[dateStringformatter stringFromDate:appointDate];
    model.dateString = dateString;
    
    return model;
}

@end
